import java.lang.reflect.Array;

public class test2 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6};
        transform(arr);
        // print(res);
        change(arr);
        System.out.println(myString(arr));
    }
    public static void transform(int[] array) {
        int[] result = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            result[i] = 2*array[i];
        }
    }
    public static void print(int[] array) {
        for (int i = 0; i < array.length; i++) {
            if(i!=array.length-1) {
                System.out.print(array[i] + ",");
            }else {
                System.out.print(array[i]);
            }
        }
    }
    public static void change(int[] arr){
        int i = 0;
        int j = arr.length-1;
        while(i<j && arr[i]%2 != 0){
            i++;
        }
        while(i<j && arr[j]%2 == 0){
            j--;
        }
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
    public static String myString(int[] arr) {
        String ret = "[";
        for (int i = 0; i < arr.length; i++) {
            ret += arr[i];
            if (i != arr.length - 1) {
                ret += ",";
            }
        }
        ret += "]";
        return ret;
    }
}
